package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ConstractPurchaseMapper;
import com.ruoyi.system.domain.ConstractPurchase;
import com.ruoyi.system.service.IConstractPurchaseService;
import com.ruoyi.common.core.text.Convert;

/**
 * 采购明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-04
 */
@Service
public class ConstractPurchaseServiceImpl implements IConstractPurchaseService 
{
    @Autowired
    private ConstractPurchaseMapper constractPurchaseMapper;

    /**
     * 查询采购明细
     * 
     * @param id 采购明细主键
     * @return 采购明细
     */
    @Override
    public ConstractPurchase selectConstractPurchaseById(Long id)
    {
        return constractPurchaseMapper.selectConstractPurchaseById(id);
    }

    /**
     * 查询采购明细列表
     * 
     * @param constractPurchase 采购明细
     * @return 采购明细
     */
    @Override
    public List<ConstractPurchase> selectConstractPurchaseList(ConstractPurchase constractPurchase)
    {
        return constractPurchaseMapper.selectConstractPurchaseList(constractPurchase);
    }

    /**
     * 新增采购明细
     * 
     * @param constractPurchase 采购明细
     * @return 结果
     */
    @Override
    public int insertConstractPurchase(ConstractPurchase constractPurchase)
    {
        return constractPurchaseMapper.insertConstractPurchase(constractPurchase);
    }

    /**
     * 修改采购明细
     * 
     * @param constractPurchase 采购明细
     * @return 结果
     */
    @Override
    public int updateConstractPurchase(ConstractPurchase constractPurchase)
    {
        return constractPurchaseMapper.updateConstractPurchase(constractPurchase);
    }

    /**
     * 批量删除采购明细
     * 
     * @param ids 需要删除的采购明细主键
     * @return 结果
     */
    @Override
    public int deleteConstractPurchaseByIds(String ids)
    {
        return constractPurchaseMapper.deleteConstractPurchaseByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除采购明细信息
     * 
     * @param id 采购明细主键
     * @return 结果
     */
    @Override
    public int deleteConstractPurchaseById(Long id)
    {
        return constractPurchaseMapper.deleteConstractPurchaseById(id);
    }
}
